package cn.fastoo.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class ConfigProps {
    private static final Logger logger = LoggerFactory.getLogger(ConfigProps.class);

    private static final Properties configProps = new Properties();

    static {
        InputStream is = null;
        try {
            is = Thread.currentThread().getContextClassLoader().getResourceAsStream("/dev/common.properties");
            logger.info("application.properties="+is);
            configProps.load(is);
        } catch (IOException e) {
            logger.error("加载属性文件出错！", e);
        } finally {
            if (is != null) {
                try {
                    is.close();
                } catch (IOException e) {
                    logger.error("释放资源出错！", e);
                }
            }
        }
    }
    public static String getNotifyUrl() {
        return configProps.getProperty("alipay.notify_url");
    }

    public static String getReturnUrl() {
        return configProps.getProperty("alipay.return_url");
    }

    public static String getNodejsUrl() {
        return configProps.getProperty("nodejs.url");
    }

    public static String getFastooApiUrl() {
        return configProps.getProperty("fastoo.api.url");
    }
}
